home *** CD-ROM | disk | FTP | other *** search
- AUTOMATON*
-
- Diffuse
-
- 'Hot' & 'cold' lines & circles are scattered over the background. Diffuse
- then proceeds to evolve the picture in a manner similar to the way that
- heat would be conducted through a medium, with different colours
- corresponding to different temperatures; white is hot & black, cold. The
- initial hot & cold regions maintain their temperature, acting as heat
- sources & sinks. Eventually a static pattern is reached. Try a 200x100
- window.
-
- INITIALISATION*
-
- 10DEF PROCdo
- 20*SetEval wrap on
- 30ENDPROC
-
- SCREEN*
-
- 10DEF PROCdo
- 20DIM buf% 256
- 30SYS "OS_ReadVarVal","sux",buf%,256:sux%=!buf%
- 40SYS "OS_ReadVarVal","suy",buf%,256:suy%=!buf%
- 50GCOL 128+32 TINT 128:CLG
- 60GCOL 0 TINT 0
- 70FOR Q%=1TO RND(4)+5:PROClin:NEXT
- 80FOR Q%=1TO RND(3):PROCcir:NEXT
- 90GCOL 63 TINT 255
- 100FOR Q%=1TO RND(4)+5:PROClin:NEXT
- 110FOR Q%=1TO RND(3):PROCcir:NEXT
- 120ENDPROC
- 130DEF PROClin
- 140MOVE RND(sux%*4)-sux%*2,RND(suy%*4)-suy%*2:DRAW BY RND(sux%*4)-sux%*2,RND(suy%*4)-suy%*2
- 150ENDPROC
- 160DEF PROCcir
- 170CIRCLE FILL RND(sux%*4)-sux%*2,RND(suy%*4)-suy%*2,RND(SQR(sux%*suy%/PI))/5
- 180ENDPROC
-
- CODE*
-
- ( CELL 0 = IF ( 0 ==)
- CELL 255 = IF (255 ==)
- READ_NEIG
- SUM_NEIG 4 + 3 >> == )
-
- END*